package com.cxx.purchasecharge.core.model.persistence;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.cxx.purchasecharge.core.model.BaseModel;

/**
 * 系统设置
 * 
 * @author xiang
 * 
 */
@Entity
@Table (name = "pc_setting_key_value")
public class SettingKeyValue extends BaseModel
{
    private static final long serialVersionUID = 1L;

    private long id;
    private String key;
    private String value;
    private String display;
    private String description;

    private SettingGroup group;
    
    public SettingKeyValue () {}

    @Id
    @GeneratedValue (strategy = GenerationType.AUTO)
    public long getId ()
    {
        return id;
    }

    public void setId (long id)
    {
        this.id = id;
    }

    @Column (nullable = false, unique = true)
    public String getKey ()
    {
        return key;
    }

    public void setKey (String key)
    {
        this.key = key;
    }

    @Column (nullable = false)
    public String getValue ()
    {
        return value;
    }

    public void setValue (String value)
    {
        this.value = value;
    }

    @Column (nullable = false)
    public String getDisplay ()
    {
        return display;
    }

    public void setDisplay (String display)
    {
        this.display = display;
    }

    public String getDescription ()
    {
        return description;
    }

    public void setDescription (String description)
    {
        this.description = description;
    }

    @ManyToOne
    @JoinColumn (name = "group_id")
    public SettingGroup getGroup ()
    {
        return group;
    }

    public void setGroup (SettingGroup group)
    {
        this.group = group;
    }
}
